package com.RedRiver.hospitalsystem.personal_service.client;

import com.RedRiver.hospitalsystem.personal_service.client.param.DepartmentChangeForm;
import com.RedRiver.hospitalsystem.personal_service.client.param.DepartmentForm;
import com.RedRiver.hospitalsystem.personal_service.client.param.PageForm;
import com.RedRiver.hospitalsystem.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * contextId是项目名，name是client的名字
 */
@FeignClient(contextId = "DepartmentClient",name="personal-service",path="personalService/department")
public interface DepartmentClient {

    @PostMapping("/findDepartment")
    Result findDepartment(@RequestBody PageForm form);

    @PostMapping("/findDepartmentNameById/{departmentId}")
    Result findDepartmentNameById(@PathVariable("departmentId") Integer departmentId);

    @PostMapping("/createDepartment")
    Result createDepartment(@RequestBody DepartmentForm departmentForm);

    @PostMapping("/changeDepartment")
    Result changeDepartment(@RequestBody DepartmentChangeForm departmentChangeForm);

    @PostMapping("/delDepartment/{departmentId}")
    Result delDepartment(@PathVariable("departmentId") Integer departmentId);
}
